package com.dyx.source.bio;

import java.io.IOException;
import java.net.Socket;

public class BIOClient {

    public static void main(String[] args) {
        for (int i = 0; i < 30; i++) {
            try {
                // 如果这里没有启动服务端的话，直接运行Client会报错误：Connection refused: connect。
                Socket socket = new Socket("127.0.0.1", 2345);
                System.out.println("client connection:" + socket);

            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
